//
//  ScaleText.m
//  HealthScale
//
//  Created by zhangjikun on 12-11-7.
//  Copyright (c) 2012年 无比动力. All rights reserved.
//

#import "ScaleText.h"

@implementation ScaleText
+(void)MyWtrte
{
//    //用户数据
//    UserInfo *userInfo0 = [[UserInfo alloc]init];
//    
//    userInfo0._nSex = 1;
//    userInfo0._nAge = 20;
//    userInfo0._nHeight = 172;
//    userInfo0._nWeight = 65;
//    
//    userInfo0._szName = @"小张";
//    
//    [ScaleData SaveScaleData:userInfo0 FileName:@"user.info"];

    //测量数据
    ScaleInfo *scaleInfo0=[[ScaleInfo alloc]init];
    
    scaleInfo0._Date = @"2012-01-01 11:11:11";
    
    scaleInfo0._SYS = 120;
    scaleInfo0._DIA = 80;
    scaleInfo0._PUL = 88;

//    NSString * scaleFileName= [NSString stringWithFormat:@"%@.dat",userInfo0._szName];
    
    NSString * scaleFileName= @"user3.dat";
    
    [ScaleData SaveScaleData:scaleInfo0 FileName:scaleFileName];
    
    
    ScaleInfo *scaleInfo1=[[ScaleInfo alloc]init];
    
    scaleInfo1._Date = @"2012-04-02 12:22:22";
    
    scaleInfo1._SYS = 130;
    scaleInfo1._DIA = 85;
    scaleInfo1._PUL = 88;
    
    [ScaleData SaveScaleData:scaleInfo1 FileName:scaleFileName];
    
    ScaleInfo *scaleInfo2=[[ScaleInfo alloc]init];

    scaleInfo2._Date = @"2012-04-03 07:33:33";
    
    scaleInfo2._SYS = 140;
    scaleInfo2._DIA = 90;
    scaleInfo2._PUL = 88;
    
    [ScaleData SaveScaleData:scaleInfo2 FileName:scaleFileName];
    
    ScaleInfo *scaleInfo3=[[ScaleInfo alloc]init];
    
    scaleInfo3._Date = @"2012-04-04 09:44:44";
    
    scaleInfo3._SYS = 160;
    scaleInfo3._DIA = 100;
    scaleInfo3._PUL = 88;
    
    [ScaleData SaveScaleData:scaleInfo3 FileName:scaleFileName];
    
}
+(void)MyRead
{

//    NSMutableArray *array =[ScaleData loadScaleData:@"MyData5.txt"];//从fileName读出数据
//    ScaleInfo *scaleInfo0=(ScaleInfo *)[NSKeyedUnarchiver unarchiveObjectWithData:[array objectAtIndex:0]];
//    NSLog(@"%@",scaleInfo0._Date);
    
    NSLog(@"MyRead!");

}
+(void)MyDelete
{
    NSLog(@"MyDelete!");
}
@end
